package com.dq.Week2.day09.pritice;

public class StringBufferDemo {


    public static void main(String[] args) {
        String s = "";
//        long start = System.currentTimeMillis();
//        for (int i = 0; i < 100000; i++) {
//            s+="a";
//        }
//
//        long end = System.currentTimeMillis();
//        System.out.println(String.format("耗时为：%d毫 秒",(end-start)));

        long start = System.currentTimeMillis();
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < 100000; i++) {
            {
                stringBuffer.append("a");
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(String.format("耗时为：%d 毫 秒",(end-start)));

    }
}
